package com.imooc.jdbc.smaple;

import java.sql.*;

public class ConnectionSample {
    public static void main(String[] args) {

        Connection conn = null;
        Statement stmt = null;

        try {
            String drive = "com.mysql.cj.jdbc.Driver";
            Class.forName(drive);
            String url = "jdbc:mysql://192.168.7.190:3306/yulei_test?useSSL=false&characterEncoding=UTF-8&useUnicode=true";
            String dbUser = "testreadwrite";
            String dbPwd = "testrw190!@#";

            conn = DriverManager.getConnection(url,dbUser, dbPwd);
            System.out.println(conn);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
//        stmt = conn.createStatement();
//        stmt.executeQuery("select * from ay_user_address;");
    }
}
